{% extends "vkontakte/layout.html" %}

{% if category %}
    {% block head_title %}Редактирование профиля{% endblock %}
{% endif %}

{% block content %}
    {% if request.user.get_profile.type == 0 %}
    <h1>Смена пароля</h1>
    <form class="float-form" action="{% url users.edit %}" method="post">
        <input type="hidden" name="form" value="password" />
        <div>
            {{ form_password.current_password.errors }}
            <label for="id_current_password">Текущий пароль:</label>
            <input id="id_current_password" type="password" name="current_password" maxlength="64" class="input plus-block" value="{{ form_password.current_password.value }}" />
            <span class="required">*</span>
        </div>
        <div>
            {{ form_password.password.errors }}
            <label for="id_password">Новый пароль:</label>
            <input id="id_password" type="password" name="password" maxlength="64" class="input plus-block" value="{{ form_password.password.value }}" />
            <span class="required">*</span>
        </div>
        <div>
            {{ form_password.repeat_password.errors }}
            <label for="id_repeat_password">Повторите пароль:</label>
            <input id="id_repeat_password" type="password" name="repeat_password" maxlength="64" class="input plus-block" value="{{ form_password.repeat_password.value }}" />
            <span class="required">*</span>
        </div>
        <div>
            <label>&nbsp;</label>
            <input type="submit" value="Сменить" class="button submit plus-block" />
        </div>
    </form>
    {% endif %}
    <h1>Аватар</h1>
    <form class="float-form" action="{% url users.edit %}" method="post" enctype="multipart/form-data">
        <input type="hidden" name="form" value="avatar" />
        <div>
            {{ form_avatar.avatar.errors }}
            <label for="id_avatar">Выберите аватар:</label>
            <input id="id_avatar" type="file" name="avatar" maxlength="512" class="input plus-block" />
        </div>
        <div>
            <label>&nbsp;</label>
            <input type="submit" value="Обновить" class="button submit plus-block" />
        </div>
    </form>
    <h1>Профиль</h1>
    <form class="float-form" action="{% url users.edit %}" method="post">
        <input type="hidden" name="form" value="profile" />
        <div>
            {{ form_profile.username.errors }}
            <label for="id_username">Ник:</label>
            <input id="id_username" type="text" name="username" maxlength="64" class="input plus-block" value="{{ form_profile.username.value }}" />
        </div>
        <div>
            {{ form_profile.first_name.errors }}
            <label for="id_first_name">Имя:</label>
            <input id="id_first_name" type="text" name="first_name" maxlength="64" class="input plus-block" value="{{ form_profile.first_name.value }}" />
        </div>
        <div>
            {{ form_profile.first_name.errors }}
            <label for="id_last_name">Фамилия:</label>
            <input id="id_last_name" type="text" name="last_name" maxlength="64" class="input plus-block" value="{{ form_profile.last_name.value }}" />
        </div>
        <div>
            <label>&nbsp;</label>
            <input type="submit" value="Обновить" class="button submit plus-block" />
        </div>
    </form>
    <p>* - поля обязательные для заполнения</p>
{% endblock %}